const db = require("../utils/db")

const selectAllClass = () =>{
  return new Promise((resolve,reject)=>{
    db.query("select * from t_class",(err,results)=>{
      if(err) reject(err)
      resolve(results)
    })
  })
}

const selectAllCourse = () => {
  return new Promise((resolve, reject) => {
    db.query("select * from t_course", (err, results) => {
      if (err) reject(err)
      resolve(results)
    })
  })
}

module.exports = {
  selectAllClass, selectAllCourse
}